HG Patch
authorroot@dyn9047022116.beaverton.ibm.com <root@dyn9047022116.beaverton.ibm.com>
Sat, 11 Mar 2006 10:46:38 +0000 (11:46 +0100)
committerroot@dyn9047022116.beaverton.ibm.com <root@dyn9047022116.beaverton.ibm.com>
Sat, 11 Mar 2006 10:46:38 +0000 (11:46 +0100)
Add feature to layer xm-test tests, grouping of tests by casename and
execution of tests by user specified lists.

Signed-off-by: Woody Marvel <marvel@us.ibm.com>
tools/xm-test/README
tools/xm-test/grouptest/create [new file with mode: 0644]
tools/xm-test/grouptest/default [new file with mode: 0644]
tools/xm-test/grouptest/quick [new file with mode: 0644]
tools/xm-test/runtest.sh

index ca5b70e81a62a301ed127441a3ae05761d569285..978e0dc693fcd63659fb715dac18f7e3fa87cdea 100644 (file)
@@ -120,8 +120,9 @@ To run the full test suite, do the following as root:
    # ./runtest.sh <logfile>
 
 This will run all tests, as well as generate and submit a report at
-the end.  All output files will begin with "<logfile>."  If you wish to
-prevent submission of a report, add "-d" to the command line like this:
+the end. All output files will begin with "<logfile>."
+If you wish to prevent submission of a report, add "-d" to the 
+command line like this:
 
    # ./runtest.sh -d <logfile>
 
@@ -131,15 +132,19 @@ submit the report at a later time.  To do so, run runtest.sh with the
 
    # ./runtest.sh -s <logfile>
 
-For people needing a quick test run instead the full suite, a quick
-mode has been added that will attempt to run a representative subset
-of tests.  This is not a substitute for the whole suite, but will
-verify that some of the major functions of xen and xm are working:
+Group test sets are supported in xm-test. This is form of layering of 
+tests groups/cases/tests. In the framework directory "grouptest",
+files exist for group processing. The user can add groups, casenames
+and test lists as required. Default group run is "grouptest/default".
+
+   # ./runtest.sh -g <groupname> <logfile>
+
+* NOTE: There is a quick set of tests in group mode, that was added to
+run certain casenames and tests. It is not a substitute for the full
+xm-test test suite.
+   # ./runtest.sh -g quick <logfile>
 
-   # ./runtest.sh -q <logfile>
 
-Because of the current structure of the reporting software, submission
-of quick test run results is not supported.
 
 It may be desirable to run a specific test group.  This can be
 accomplished by doing the following:
diff --git a/tools/xm-test/grouptest/create b/tools/xm-test/grouptest/create
new file mode 100644 (file)
index 0000000..359af40
--- /dev/null
@@ -0,0 +1 @@
+create
diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default
new file mode 100644 (file)
index 0000000..66ba66c
--- /dev/null
@@ -0,0 +1,30 @@
+block-create
+block-destroy
+block-list
+console
+create
+destroy
+dmesg
+domid
+domname
+enforce_dom0_cpus
+help
+info
+list
+memmax
+memset
+migrate
+network
+network-attach
+pause
+reboot
+restore
+save
+sedf
+shutdown
+sysrq
+unpause
+vcpu-disable
+vcpu-pin
+vtpm
+
diff --git a/tools/xm-test/grouptest/quick b/tools/xm-test/grouptest/quick
new file mode 100644 (file)
index 0000000..2b538af
--- /dev/null
@@ -0,0 +1,4 @@
+create 01_create_basic_pos.test 07_create_mem64_pos.test 10_create_fastdestroy.test 14_create_blockroot_pos.test
+unpause 01_unpause_basic_pos.test
+memset 01_memset_basic_pos.test 03_memset_random_pos.test
+help 06_help_allcmds.test
index 25aa2d842d49bca4c85c9be6cbfde358b6b4fd31..ec9363ea8d429d631099a68c09546e8f1d38c641 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh 
 
 ##
 ## Test driver script
@@ -11,7 +11,7 @@ usage() {
     echo "  Where opts are:"
     echo "  -d          : do not submit a report for this run"
     echo "  -b          : do not ask any questions (batch mode)"
-    echo "  -q          : run a quick test set"
+    echo "  -g          : run a group test set"
     echo "  -e <email>  : set email address for report"
     echo "  -s <report> : just submit report <report>"
     echo "  -h | --help : show this help"
@@ -92,12 +92,13 @@ runnable_tests() {
     echo "Running sanity checks..."
     make -C tests/_sanity check 2>&1 | grep REASON
     if [ $? -eq 0 ]; then
-       echo "Sanity checks failed"
-       exit 1
+        echo "Sanity checks failed"
+        exit 1
     fi
 
 }
 
+
 # Get contact info if needed
 get_contact_info() {
     
@@ -128,26 +129,21 @@ get_contact_info() {
 
 # Run the tests
 run_tests() {
-    output=$1
-    echo Running real tests...
-    TEST_VERBOSE=1 make -k check > $output 2>&1
-}
-
-run_tests_quick() {
+    groupentered=$1
+    output=$2
 
-    output=$1
+    exec <  grouptest/$groupentered
+    while read casename testlist; do
+       echo Running $casename tests...
+       echo "*** case $casename from group $groupentered" >> $output
+       if [ -z "$testlist" ]; then
+          echo "*** Running tests for case $casename" >> $output
+          (cd tests/$casename && TEST_VERBOSE=1 make -k check) >> $output 2>&1
+       else
+          echo "*** Running tests $testlist from case $casename" >> $output
+          (cd tests/$casename && TEST_VERBOSE=1 make -k check TESTS="$testlist") >> $output 2>&1
+       fi
 
-    create_tests="01_create_basic_pos.test 07_create_mem64_pos.test 10_create_fastdestroy.test 14_create_blockroot_pos.test"
-    unpause_tests="01_unpause_basic_pos.test"
-    memset_tests="01_memset_basic_pos.test 03_memset_random_pos.test"
-    help_tests="06_help_allcmds.test"
-    testgroups="create unpause memset help"
-
-    echo "*** Quick test" > $output
-    for group in $testgroups; do
-       eval $(echo list=\$${group}_tests)
-       echo "*** Running tests [$list] from $group"
-       (cd tests/$group && TEST_VERBOSE=1 make -k check TESTS="$list") >> $output 2>&1
     done
 
 }
@@ -195,6 +191,7 @@ MAXFAIL=10
 report=yes
 batch=no
 run=yes
+GROUPENTERED=default
 
 # Resolve options
 while [ $# -gt 0 ]
@@ -213,8 +210,13 @@ while [ $# -gt 0 ]
          echo $1 > contact_info
          echo "(Email set to $1)"
          ;;
-      -q)
-         run=quick
+      -g)
+         shift
+          GROUPENTERED=$1
+          if [ ! -f grouptest/$GROUPENTERED ]; then
+             echo "No file for group $GROUPENTERED"
+             exit 1
+          fi
          ;;
       -s)
          run=no
@@ -265,18 +267,15 @@ fi
 if [ "$run" != "no" ]; then
     runnable_tests
     make_environment_report $OSREPORTTEMP $PROGREPORTTEMP
-    if [ "$run" = "yes" ]; then
-       run_tests $OUTPUT
-    else
-       run_tests_quick $OUTPUT
-    fi
+    run_tests $GROUPENTERED $OUTPUT
     make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT
     make_result_report $OUTPUT $RESULTREPORTTEMP
     cat $OSREPORTTEMP $PROGREPORTTEMP $RESULTREPORTTEMP > $XMLREPORT
     rm $OSREPORTTEMP $PROGREPORTTEMP $RESULTREPORTTEMP
+
 fi
 
-if [ "$report" = "yes" ] && [ "$run" = "yes" ]; then
+if [ "$report" = "yes" ]; then
     if [ ! -f "$XMLREPORT" ]; then
        echo "No such file: $XMLREPORT"
        exit 1